package excepuion;

public class ThrowDemo {
    public static void main(String[] args) {
        Person ps = new Person();
        try {
            ps.setAge(1000);
        } catch (IllegalAgeException e) {
            e.printStackTrace();
            //System.out.println("出错了");
            System.out.println(e.getMessage());
        }
        System.out.println("此人的年龄是:"+ps.getAge()+"岁");
    }
}
